<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
	*{margin:0;padding:0;}
	#container{width:992px;height:292px;border:4px solid rgba(0,0,0,.3)}
	</style>
	<script type="text/javascript" src="http://api.map.baidu.com/api?key=abcd&v=1.4&services=true"></script>
	<script type="text/javascript" src="http://api.map.baidu.com/library/CurveLine/1.5/src/CurveLine.min.js"></script>
	<title>地图展示</title>
</head>
<body>
<div id="container"></div> 
<script type="text/javascript"> 
/**
采用HTML5的geolocation API功能获得你的位置
(function getLocation()
  {
  if (navigator.geolocation)
    {
    navigator.geolocation.getCurrentPosition(bMap);
    }
  else{alert("Geolocation is not supported by this browser.");}
  })();
function bMap(position){
var map = new BMap.Map("container");          // 创建地图实例  
var point = new BMap.Point(position.coords.longitude, position.coords.latitude);  // 创建点坐标  
map.centerAndZoom(point, 15);                 // 初始化地图，设置中心点坐标和地图级别  
var marker = new BMap.Marker(point);  // 创建标注
	map.addOverlay(marker);              // 将标注添加到地图中

var label = new BMap.Label("我在这里哦",{offset:new BMap.Size(20,-10)});
marker.setLabel(label);
}
*/
(function bMap(){
var map = new BMap.Map("container");          // 创建地图实例  
var point = new BMap.Point(117.90785, 28.448983);  // 创建点坐标  
map.centerAndZoom(point, 8);                 // 初始化地图，设置中心点坐标和地图级别  
var marker = new BMap.Marker(point);  // 创建标注
	map.addOverlay(marker);              // 将标注添加到地图中
	marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
var label = new BMap.Label("我在这里哦",{offset:new BMap.Size(20,-10)});
marker.setLabel(label);

map.addControl(new BMap.MapTypeControl());//
setTimeout(function(){
		map.setZoom(6);   
	}, 2000);  //2秒后放大到6级
	map.enableScrollWheelZoom(true);//添加控制功能
	
var beijingPosition=new BMap.Point(116.432045,39.910683),
	hangzhouPosition=new BMap.Point(120.129721,30.314429),
	shangraoPosition=new BMap.Point(117.90785, 28.448983);
var points = [beijingPosition,hangzhouPosition, shangraoPosition];

var curve = new BMapLib.CurveLine(points, {strokeColor:"blue", strokeWeight:3, strokeOpacity:0.5}); //创建弧线对象
map.addOverlay(curve); //添加到地图中
curve.enable
})();
</script>
</body>
</html>
